<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
<?php
$id = intval($_REQUEST['id']);
$tensanpham = $_REQUEST['tensanpham'];
$hinhsanpham = $_REQUEST['hinhsanpham'];
//$gia = $_REQUEST['gia'];
$id_danhmuc = $_REQUEST['id_danhmuc'];
//$ngaycapnhat = $_REQUEST['ngaycapnhat'];
$tinhtrang = $_REQUEST['tinhtrang'];

include 'conn.php';

$sql = "update sanpham set tensanpham='$tensanpham',hinhsanpham='$hinhsanpham',id_danhmuc=$id_danhmuc,tinhtrang=$tinhtrang where id_sanpham=$id";
$result = @mysql_query($sql);
if ($result){
	echo json_encode(array('success'=>true));
} else {
	echo json_encode(array('msg'=>'Some errors occured.'));
}
?>